List Merge(List L1, List L2) {
    List L, p, q, r;
    L = (List)malloc(sizeof(struct Node));
    p = L1->Next;
    q = L2->Next;
    L->Next = NULL;
    r = L;
    while (p != NULL && q != NULL) {
        if (p->Data <= q->Data) {
            r->Next = p;
            p = p->Next;
            r = r->Next;
        }
        else {
            r->Next = q;
            q = q->Next;
            r = r->Next;
        }
    }
    if (p != NULL)  r->Next = p;
    if (q != NULL)  r->Next = q;
    L1->Next = NULL;
    L2->Next = NULL;
    return L;
}